package com.ssqdx.demo04;

import com.ssqdx.demo02.Userservice;
import com.ssqdx.demo02.UserserviceImpl;

/**
 * @author asus
 * @date 2021/6/8 12:55:01
 * @description
 */
public class Client {
    public static void main(String[] args) {
        //真实角色
        UserserviceImpl userservice = new UserserviceImpl();
        //代理角色，不存在
        ProxyInvocationHandler pih = new ProxyInvocationHandler();

        pih.setTarget(userservice);//设置要代理的对象
        //动态生成代理类
        Userservice proxy = (Userservice) pih.getProxy();
        proxy.delete();
    }
}
